﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using eBay;

namespace eBayMonitorer
{
    public partial class mainFrm : Form
    {
        public mainFrm()
        {
            InitializeComponent();
        }

        private void button3_Click(object sender, EventArgs e)
        {

            main.FindItems(
                tbQueryString.Text,
                sortOrderAscending.Checked ? SortOrderCodeType.Ascending : SortOrderCodeType.Descending,
                tbResultsToShow.Text == "" ? 10 : Int32.Parse(tbResultsToShow.Text),
                cbHideDuplicates.Checked,
                tbPostalIndex.Text,
                (lbSortBy.SelectedIndex >= 0 ? (SimpleItemSortCodeType)lbSortBy.SelectedIndex : (SimpleItemSortCodeType)(-1))
                );
        }

        private void getCategoriesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            main.getCategories();
        }

        private void getOfficialTimeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            main.GeteBayOfficialTime();
        }

        private void getSearchKeywordRecommendationToolStripMenuItem_Click(object sender, EventArgs e) {
            Form f = new frmGetSearchKeywordsRecommendation();
            f.Show(this);
        }

        private void findItemToolStripMenuItem_Click(object sender, EventArgs e) {
            Form f = new frmFindItemsAdvanced();
            f.Show(this);
        }

        private void findItemsByCategoryToolStripMenuItem_Click(object sender, EventArgs e) {
            Form f = new frmFindItemsByCategory();
            f.Show(this);
        }
    }
}
